#!/usr/bin/env python
# -*- coding:utf-8 -*- 
# Author: Jeokayne Ataier

import socket

client = socket.socket(socket.AF_INET,socket.SOCK_STREAM)

client.connect(("127.0.0.1",8881))

welcome_msg = client.recv(1024).decode("utf-8")
print(welcome_msg)

check_on = True

while check_on:
    client_msg = input("Input your question:").encode("utf-8")
    if  not client_msg:
        print("Service Closed!")
        break
    client.sendall(client_msg)
    server_msg = client.recv(1024).decode("utf-8")
    print("Server:",server_msg)